<?php
/**
 * Description of Event Trigger
 *
 * @author trunghpb
 */
class fwiEventTrigger {
    private $triggerBefore;
    
    public function createTriggerBefore($eventName, $triggerFunc, $triggerName = false){
        if ($triggerName === false){
            $this->triggerBefore[$eventName][] = $triggerFunc;
        }else{
            $this->triggerBefore[$eventName][$triggerName] = $triggerFunc;
        }
    }

    public function dropTriggerBefore($eventName, $triggerName){
        unset($this->triggerBefore[$eventName][$triggerName]);
    }

    public function isTriggerBeforeExisted($eventName){
        return isset($this->triggerBefore[$eventName]);
    }

    public function getTriggerBefore($eventName){
        return $this->triggerBefore[$eventName];
    }
}
?>
